<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h1>列表页面</h1>
<div>
  <div v-for="i in arr">
    <h3>{{i.title}}</h3>
    <p>{{i.created}} <a href="javascript:void(0)" @click="f(i.id)">删除</a></p>
      <img v-for = "url in arr" src="url" width="100">
  </div>
</div>
<!--引入axios和vue框架文件-->
<script src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.1/axios.min.js"></script>
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<script>
    let v = new Vue({
        el:"body>div",
        data:{
            arr:[]
        },
        methods:{
            f(id){
                    axios.get("/delete?id="+id).then(function () {
                        location.reload();
            })
        },
      created:function () {
        axios.get("/select").then(function (response) {
          v.arr = response.data;

          for (let image of v.arr){
              image.add = image.urls.split(",")
          }
        })
      }
    })
</script>
</body>
</html>